

**REPLICATION FOR PLoS ONE CORTISOL VOTING ANALYSIS
**SYNTAX RUN ON "PLoS CORT REPLICATION DATA.SAV' SHOULD REPLICATE TABLES 1, 2 AND 3 REPORTED IN ARTICLE

**NOTE--HAVE TO FILL IN CORRECT PATH NAME TO CALL SPSS DATA FILE -- PATH BELOW IS FOR KBS PC

GET
  FILE='X:\MyFiles\papers\HSD\Data\master data sets\cortisol voting data\PLoS One R&R\PLoS One R&R 2\PLoS cort replication data.sav'.
DATASET NAME DataSet2 WINDOW=FRONT.

**********************************************************************************************************************
**Table 1
*******************************************************************************************************************

**this splits file into those selected for study and those who were not 1.0 group is the study group

SORT CASES  BY studyselected.
SPLIT FILE SEPARATE BY studyselected.
DESCRIPTIVES VARIABLES=age education income demog1
  /STATISTICS=MEAN STDDEV MIN MAX.

SPLIT FILE OFF.

**this just gives descriptives of entire recruitment pool

DESCRIPTIVES VARIABLES=age education income demog1
  /STATISTICS=MEAN STDDEV MIN MAX.

************************************************************************************************************************************
**FIGURE 1
************************************************************************************************************************************

**BAR GRAPH -- CORTISOL CHANGE BY  VOTING CONDITION, ERROR BARS = 1.0 STANDARD ERROS

GRAPH
  /BAR(SIMPLE)=MEAN(electcortWIN) BY Condition
  /INTERVAL SE(1.0).


**THIS IS THE ANOVA TO ACCOMPANY FIGURE 1--REPORTED IN TEXT


ONEWAY electcortWIN BY Condition
  /MISSING ANALYSIS
  /POSTHOC=TUKEY LSD DUNNETT (1) ALPHA(0.05).



*************************************************************************************************************************************
**Table 2
**********************************************************************************************************************************

**this is a filter to insure we just use subjects that were in the study sample rather than the entire recruitment pool
**studyselected = 1 if subject was in study sample

USE ALL.
COMPUTE filter_$=(studyselected = 1).
VARIABLE LABELS filter_$ 'studyslected = 1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

ONEWAY shortermnegaff age education income PreCortNgML BY Condition
  /STATISTICS DESCRIPTIVES
  /MISSING ANALYSIS.


FILTER OFF.
USE ALL.
EXECUTE.


**************************************************************************************************************************
**Table 3
**********************************************************************************************************************

**Model 3

REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN
  /DEPENDENT PostCortNgMl
  /METHOD=ENTER PreCortNgML absentee poll shortermnegaff demog1 age education income.


**Model 2

REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN
  /DEPENDENT electcortwin
  /METHOD=ENTER PreCortNgML absentee poll shortermnegaff demog1 age education income.


**Model 1

REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN
  /DEPENDENT electcortwin
  /METHOD=ENTER absentee poll 

*************************************************************************************************************************************

**This syntax can be modified to pull out any variables in the data set to create subsets of the dataset

*************************************************************************************************************************************

save outfile = 'X:\MyFiles\papers\HSD\Data\master data sets\cortisol voting data\PLoS One R&R\PLoS One R&R 2\PLoS cort replication data.sav' 
 /keep PostCortNgMl PreCortNgML absentee poll shortermnegaff demog1 age education income condition electcortwin
 /compressed





